package com.hxd.mall.module.school.enter

import com.hxd.mall.network.base.BaseRequest
import com.hxd.mall.network.service.IAccountFunctionApi
import com.hxd.mall.network.service.IMeFunctionApi
import com.hxd.mall.network.service.ManagerFunctionApi.mICollagePageApi
import com.hxd.mall.utils.open.ToastUtil
import javax.inject.Inject

/**
 * @author zhaoyong
 * @description:
 * @date :2019-07-19 18:43
 */
class SchoolPresenter @Inject constructor(var mView: ISchoolView) : ISchoolPresenter {

    override fun getCollegeData() {

    }

    override fun getData(isRefresh: Boolean) {
        BaseRequest.requestFinishRefresh(mICollagePageApi.collagePage, mView, {
            mView.fetchData(it)
        }, {
            ToastUtil.showToast(it.msg ?: "")
        })
    }

    override fun getData(
        isRefresh: Boolean,
        borrowName: String?,
        borrowState: String?,
        createTime: String?
    ) {
        /*mMainFunctionApi!!.getCustomer(
            borrowName,
            borrowState,
            createTime
        ).run {
            if (!isRefresh) {
                BaseRequest.request(
                    this, mView, {
                        mView.showData(it)
                    }, {
                        mView.stopFresh()
                        mView.hideLoading()
                    }, false
                )
            } else {
                BaseRequest.requestFinishRefresh(
                    this, mView, {
                        mView.showData(it)
                    }, {
                        mView.stopFresh()
                        mView.hideLoading()
                    }, false
                )
            }
        }*/

    }
}